package com.yearner.reviewplan.manage.system.bean;


import com.yearner.reviewplan.manage.system.entity.UserRouter;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author pengyg
 * @since 2020/1/16
 */
@Getter
@Setter
public class RouterVo {
    private Integer routerId;
    private Integer parentId;
    private Boolean isLock;
    private Boolean cache;
    private String name;
    private String path;
    private String permission;
    private String component;
    private String componentPath;
    private RouterMeta meta;
    private List<RouterVo> children;
    private String creator;
    private String updater;
    public RouterVo(){}

    public RouterVo(UserRouter router) {
        this.routerId = router.getRouterId();
        this.parentId = router.getParentId();
        this.isLock = router.getILock();
        this.cache = router.getCache();
        this.name = router.getRouterName();
        this.path = router.getUrl();
        this.permission = router.getPermission();
        this.component = router.getComponent();
        this.componentPath = router.getComponentPath();
        this.meta = new RouterMeta();
        meta.setAuth(true);
        meta.setCache(router.getCache());
        meta.setTitle(router.getTitle());
        this.creator = router.getCreator();
        this.updater = router.getUpdater();
        this.children = null;
    }
}
